package Stack;

import java.util.Stack;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 故我
 * Date: 2024-02-01
 * Time: 20:06
 */
public class TestMain {
    public static void main(String[] args) {
        MyStack stack = new MyStack();
        stack.push(1);
        stack.push(2);
        stack.push(3);
        stack.push(4);
        while (!stack.empty()) {
            Integer it = stack.peek();
            System.out.print(it + " ");
            stack.pop();
        }
        System.out.println();

//        Stack<Integer> stack = new Stack<>();
//        stack.push(1);
//        stack.push(2);
//        stack.push(3);
//        stack.push(4);
//        Integer a = stack.peek();
//        System.out.println(a);
//
//        while (!stack.empty()) {
//            Integer it = stack.peek();
//            System.out.print(it + " ");
//            stack.pop();
//        }
//        System.out.println();
//        System.out.println(stack.size());
    }
}
